function replicate(obj,varargin)
%Select atoms of a given element

vec = varargin{1};

A = obj.Periodicity;

for kp=1:3

    indexes = obj.Atoms.keys;
    for ka=1:numel(indexes)
       Atom = obj.get_atom(indexes{ka});
       pos = Atom.Position;
       for n = 1:vec(kp)
           
         new_pos = pos + n * A(kp,:); 
         obj.add_atom(new_pos,Atom.Kind); 
       end
    end
end

newP = zeros(3,3);
newP(:,1) = A(:,1) * vec(1);
newP(:,2) = A(:,2) * vec(2);
newP(:,3) = A(:,3) * vec(3);

obj.Periodicity = newP + A;

end